Skip to content

Fix DKIM: use relaxed/relaxed canonicalization, reject non-FQDN senders#572

Merged
asim merged 1 commit intomainfrom
claude/add-wallet-transfers-74PHC
Apr 21, 2026
Merged

Fix DKIM: use relaxed/relaxed canonicalization, reject non-FQDN senders#572
asim merged 1 commit intomainfrom
claude/add-wallet-transfers-74PHC

Conversation

@asim
Copy link
Copy Markdown
Member

@asim asim commented Apr 21, 2026

DKIM signing:
Changed from simple/simple (library default) to relaxed/relaxed canonicalization. Google is strict about whitespace — simple mode causes verification failures if any mail processor touches header or body whitespace in transit. Also added explicit HeaderKeys list (from, to, subject, date, message-id, mime-version, content-type) instead of signing all headers, which is more predictable.

SMTP sender validation:
The inbound SMTP server was accepting mail from addresses like "no-reply@wetransfer" — that's not a valid FQDN (no dot in the domain). Added three validation checks before the existing anti-spoofing and blocklist:

  1. Address must parse (mail.ParseAddress)
  2. Must have a non-empty domain after @
  3. Domain must contain a dot (FQDN check)

Rejects with 550 and logs the specific reason.

https://claude.ai/code/session_01GRGLA9yj7BpqKiyi6xFwnm

DKIM signing:
Changed from simple/simple (library default) to relaxed/relaxed
canonicalization. Google is strict about whitespace — simple mode
causes verification failures if any mail processor touches header
or body whitespace in transit. Also added explicit HeaderKeys list
(from, to, subject, date, message-id, mime-version, content-type)
instead of signing all headers, which is more predictable.

SMTP sender validation:
The inbound SMTP server was accepting mail from addresses like
"no-reply@wetransfer" — that's not a valid FQDN (no dot in the
domain). Added three validation checks before the existing
anti-spoofing and blocklist:
1. Address must parse (mail.ParseAddress)
2. Must have a non-empty domain after @
3. Domain must contain a dot (FQDN check)

Rejects with 550 and logs the specific reason.

https://claude.ai/code/session_01GRGLA9yj7BpqKiyi6xFwnm
@asim asim merged commit e81ece4 into main Apr 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants